Expand description
multilink is an IPC library that allows communication via two methods:
- Local processes/stdio: JSON-RPC messages are passed between parent/child process via stdin/stdout
- Remote processes/HTTP: HTTP requests/responses are passed between processes on remote hosts
Utilizes tower
to handle RPC calls.
Moving parts
Here are the moving parts of a solution that uses multilink:
- One set of protocol-agnostic request and response types: types that are used in all services, regardless of the underlying protocol; usually a set of enums
- The handling services: processes the protocol-agnostic requests, performs some logic and returns responses
- Conversion trait implementations: converts the protocol-agnostic requests/responses into JSON-RPC or HTTP request/responses
- HTTP and “JSON-RPC over stdio” clients and servers: the only part implemented by multilink; brings the three items above together
The caller of a multilink client will only use the protocol-agnostic request and response types, which allows seamless switching between protocols.
Re-exports
pub use error::ProtocolError;
pub use tower;
Modules
- Protocol error types.
- HTTP server and client.
- JSON-RPC types and methods.
- JSON-RPC over stdio server and client.
- Miscellaneous utility functions.
Enums
- A response container returned by a multilink service.
Constants
- Default request timeout.
Traits
- A configuration data structure that provides an example for generating new TOML configuration files. The example should include customizable fields with comments explaining their purpose.
Type Definitions
- A boxed dynamic type for multilink services. The service must return a result with a
ServiceResponse
orServiceError
. - A stream of multiple response results returned by the service.
- A boxed error type that may be returned by service calls.
- A future that returns a result with a generic response and
ServiceError
. This is returned by service calls.